package com.smashcrush.client.rest;

import java.util.Map;

import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.smashcrush.model.BrowserType;
import com.smashcrush.model.ExecuteScriptParameters;

@Path("/api/browser")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public interface ClientBrowserService {

	@POST
	@Path("openSession/token/{token}/browserType/{browserType}/domain/{domain}")
	public String openSession(@PathParam("token") String token,
			@PathParam("browserType") BrowserType browserType,
			@PathParam("domain") String domain);

	@POST
	@Path("executeScript/token/{token}/sessionId/{sessionId}")
	public void closeSession(@PathParam("token") String token,
			@PathParam("sessionId") String sessionId);

	@POST
	@Path("executeScript/token/{token}/sessionId/{sessionId}")
	public Map<String, String> executeScript(@PathParam("token") String token,
			@PathParam("sessionId") String sessionId,
			ExecuteScriptParameters parameters);

	@POST
	@Path("executeScriptByName/token/{token}/sessionId/{sessionId}/domain/{domain}/name/{name}")
	public Map<String, String> executeScriptByName(
			@PathParam("token") String token,
			@PathParam("sessionId") String sessionId,
			@PathParam("domain") String domain, @PathParam("name") String name,
			ExecuteScriptParameters parameters);

	@POST
	@Path("executeScriptByName/token/{token}")
	public Map<String, String> executeScriptByName(
			@PathParam("token") String token, String bears,
			ExecuteScriptParameters parameters, Integer ppoo);

}